package com.mini.vo;

public enum CommonResultMessage {

    ERROR(-1L,"system error"),
    SUCCESS(0L, "ok"),
    PARAMS_ERROR(10001L,"参数错误"),
    BUSINESS_ID_ERROR(10002L,"非法的小课站点"),
    BUSINESS_LOCK(10003L,"lock"),
    NO_STUDENT_INFO(10004L,"未查找到学员信息"),
    PHONENO_ERROR(10005L,"手机号格式错误"),
    NO_TEACHER_INFO(10006L,"没有查到运营专员信息"),
    ORDER_NO_EXITES(10007L,"订单号重复"),
    NO_BIG_PRICE_INFO(10008L,"未查找到大课金额相关信息"),
    GROUP_NO_ADD_WECHAT_MAX(10009L,"设置失败，运营组必须保证有一个运营专员能正常加微！"),
    SIGN_ERROR(10011L,"签名错误"),
    ;

    public final Long code;
    public final String message;

    CommonResultMessage(Long code, String message) {
        this.code = code;
        this.message = message;
    }

    public static CommonResultMessage getResult(Long code) {
        for (CommonResultMessage resultMessage : CommonResultMessage.values()) {
            if (resultMessage.code.equals(code)) {
                return resultMessage;
            }
        }
        return null;
    }

    public Long getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }
}
